﻿

#include "MGPrecond.hpp"

template <typename Cmpt>
UNAP::MGPrecond<Cmpt>::MGPrecond(const Matrix<Cmpt> &A, MGSolver<Cmpt> *MG)
    : Preconditioner<Cmpt>(A.getCommunicator()),
      rD_(A.diag()),
      nCycles_(1),
      MGpreond_(MG) {}

template <typename Cmpt>
void UNAP::MGPrecond<Cmpt>::precondition(Vector<Cmpt> &w,
                                         const Vector<Cmpt> &r) const {
  MGpreond_->precond(w, r, nCycles_);
}

template class UNAP::MGPrecond<scalar>;
